package com.github.thinwonton.spring.web.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.thinwonton.spring.entity.Content;

@Controller
@RequestMapping("/api/portal")
public class PortalController {

	/**
	 * 内容列表
	 * 
	 * @return
	 */
	@RequestMapping(value = "/list", method = RequestMethod.GET, produces = { "application/json;charset=UTF-8" })
	@ResponseBody
	public List<Content> listContent() {
		System.out.println("listContent");
		int count = 5;
		List<Content> list = new ArrayList<>();
		for (int i = 0; i < count; i++) {
			list.add(new Content(i + 1, "内容：" + (i + 1)));
		}

		return list;
	}

}
